package com.fire.control.system.support.util;

import java.util.HashMap;
import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;

public class JsonMapUtil {
	private static Log logger = LogFactory.getLog(JsonMapUtil.class);
	// Json to map util
	public static Map<String, Object> getJson(String str) {
		Map<String, Object> map = new HashMap<String, Object>();
		ObjectMapper mapper = new ObjectMapper();
		try {
			map = mapper.readValue(str, new TypeReference<HashMap<String, Object>>() {
			});
			logger.info("最后返回的结果是:" + map);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return map;
	}
}
